<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>PMS-business</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<script type="text/javascript">
			window.$ = window.jQuery = require('./assets/js/jquery.js');
		</script>
		<script src="./js/jquery.window.reference.js"></script>
		<style>
			.dropdown-submenu { 
				position: relative; 
			} 
			.dropdown-submenu > .dropdown-menu { 
				top: 0;  
				margin-top: -6px; 
				margin-left: -1px; 
				-webkit-border-radius: 0 6px 6px 6px; 
				-moz-border-radius: 0 6px 6px; 
				border-radius: 0 6px 6px 6px; 
			} 
			.dropdown-submenu:hover > .dropdown-menu { 
				display: block; 
			} 
			.dropdown-submenu > a:after { 
				display: block; 
				content: " "; 
				float: right;  
				width: 0; 
				height: 0; 
				border-color: transparent;  
				border-style: solid; 
				border-width: 5px 0 5px 5px; 
				border-left-color: #ccc; 
				margin-top: 5px; 
				margin-right: -10px; 
			} 
			.dropdown-submenu:hover > a:after { 
				border-left-color: #fff; 
			} 
			.dropdown-submenu.dropdown-right > .dropdown-menu { 
				left: 100% !important;
			} 
			.dropdown-submenu.dropdown-left > .dropdown-menu {   
				left: -100% !important;  
			}
		</style>
	</head>

	<body class="no-skin" style="overflow:hidden;">
		<div id="navbar" class="navbar navbar-default navbar-collapse collapse">  
    		<script type="text/javascript">
				try{ace.settings.check('navbar','fixed')}catch(e){}
			</script>
			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="javascript:void(0);" class="navbar-brand"> 
						<small id="index_Title"></small>
					</a> 
				</div>
				<div class="navbar-buttons navbar-header pull-right  collapse navbar-collapse" role="navigation">
					<ul class="nav ace-nav">
						<li class="blue dropdown-modal ctrl" style="margin-right:10px;">
							<a id="background"  href="index.html" class="dropdown-toggle" > 
								<span data-i18n="PC版"  class="">PC版</span>  
							</a>
						</li>
						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
									<img class="nav-user-photo" src="./assets/avatars/user.jpg" alt="Jason's Photo" />
									<span id="loginUser" class="user-info">
										<small data-i18n="欢迎您">欢迎您</small>
									</span>
									<i class="ace-icon fa fa-caret-down"></i>   
		                     	</a>
								<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close"
									style="-webkit-transform: scale(1.5) rotate(0deg);margin-top: 35px;margin-right: 41px;">
		                            <li>
		                                <a data-i18n="注销" id="indexOff" href="javaScript:void(0);">
		                                    <i class="ace-icon fa fa-sign-out"></i>注销 
		                                </a>
		                            </li> 
									<li>
		                                <a data-i18n="退出" id="indexOffOut" href="javaScript:void(0);">
		                                    <i class="ace-icon fa fa-sign-out"></i>退出 
		                                </a>
		                            </li> 
								</ul> 
	                     </li>
					</ul>
				</div>
			</div>	
    	</div>
		<div class="main-container" id="main-container">
            <div  class="main-content" id="main-content-index"> 
            	<div class="main-content-inner">
	                <div class="page-content">	
	                    <div id="pagemain" class="page-content-area" data-ajax-content=true></div>
	                </div>
	            </div> 
            </div> 
        </div>

        <script>
			//初始化参数
            var hotelId = localStorage.getItem("hotelId");
            var bmh = localStorage.getItem("bmh");
            var userid = localStorage.getItem("userid");
			var token = localStorage.getItem("token");
            $.HSAPI_HEADERS.hotelId = hotelId;
            $.HSAPI_HEADERS.bmh = bmh;
            $.HSAPI_HEADERS.token = token;
			$.HSAPI_USERID = userid;
			localStorage.removeItem('openWin');
	
			$("#loginUser").append(userid);
			
			//全局配置ajax变量
			jQuery.ajaxSetup({
				headers : $.HSAPI_HEADERS,
				complete:function(){
					$("#pageOverlay").addClass("hide");
					$("#loading").addClass("hide");
				}
			});

			//交互
			function doAjax(data,async=false,success,error){
				jQuery.ajax({  
					type : 'POST',
					url : $.HSAPI_AJAXURL+"/qms/mobile/procedure2",   
					data : data,
					dataType : 'json',  
					async:async,
					success : function(data) {  
						success(data);
					},  
					error : function(data) {  
						error();
					}  
				});
			}

			//获取酒店参数
			doAjax($.HSAPI_ASKJSONINFO('{}',"ListRetrieveAlinarg",'{}','list'),false,
				function(data){
					localStorage.setItem("alinarg",JSON.stringify(data.DATA)); 
				},
				function(data) {  
					jf_alert("获取酒店参数失败<br>原因:"+data);
			});

			//获取字典
			jf_getPosDict("all","");
			doAjax($.HSAPI_ASKJSONINFO( '{}','ExecHoDictRetrieveDefault','{}','list'),false,
				function(data){
					localStorage.setItem("hodict",JSON.stringify(data.DATA)); 
				},
				function(data) {  
					jf_alert("获取字典失败<br>原因:"+data);
			});

			//获取按钮权限
			doAjax($.HSAPI_ASKJSONINFO(JSON.stringify({}),'HoLoginStoreList',JSON.stringify({})),false,
				function(data){
					localStorage.setItem("button_authority",JSON.stringify(data.button));
				},
				function(data) {  
					jf_alert("获取按钮权限<br>原因:"+data);
			});

			//注销
			$("#indexOff").bind('click',function(){
				jf_alert("确定注销当前用户?",function(){
					localStorage.removeItem("token");
					window.location.href='./html/login/login.html';
				});
			});

			//退出
			$("#indexOffOut").bind('click',function(){
				jf_alert("确定退出?",function(){
					localStorage.removeItem("token");
					$.HSAPI_CLOSEEXE();
				});
			});

			$.HSAPI_CLEARMENU();

		</script>
	</body>
</html>
